package io.wdb.wxapp.model;

import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModelProperty;

import io.wdb.modules.activity.wxapp.entity.HdScanActivityEntity;


/**
 * 扫码地推
 * 
 * @author wdb
 * @email xulin@wdb007.com
 * @date 2018-02-01 16:57:29
 */
public class HdScanActivityModel implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value = "", required = true)
	private String id;
	@ApiModelProperty(value = "手机号", required = true)
	private String mobile;
	@ApiModelProperty(value = "扫码地点", required = true)
	private String area;
	@ApiModelProperty(value = "赠送金额(分)", required = true)
	private Integer money;
	@ApiModelProperty(value = "活动时间", required = true)
	private Date createTime;
	@ApiModelProperty(value = "0未送1已送", required = true)
	private Integer status;
	@ApiModelProperty(value = "", required = true)
	private String hdUserId;
	@ApiModelProperty(value = "", required = true)
	private String hdScanConfigId;

	/**
	 * 设置：
	 */
	public void setId(String id) {
		this.id = id;
	}
	/**
	 * 获取：
	 */
	public String getId() {
		return id;
	}
	/**
	 * 设置：手机号
	 */
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	/**
	 * 获取：手机号
	 */
	public String getMobile() {
		return mobile;
	}
	/**
	 * 设置：扫码地点
	 */
	public void setArea(String area) {
		this.area = area;
	}
	/**
	 * 获取：扫码地点
	 */
	public String getArea() {
		return area;
	}
	/**
	 * 设置：赠送金额(分)
	 */
	public void setMoney(Integer money) {
		this.money = money;
	}
	/**
	 * 获取：赠送金额(分)
	 */
	public Integer getMoney() {
		return money;
	}
	/**
	 * 设置：活动时间
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	/**
	 * 获取：活动时间
	 */
	public Date getCreateTime() {
		return createTime;
	}
	/**
	 * 设置：0未送1已送
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}
	/**
	 * 获取：0未送1已送
	 */
	public Integer getStatus() {
		return status;
	}
	/**
	 * 设置：
	 */
	public void setHdUserId(String hdUserId) {
		this.hdUserId = hdUserId;
	}
	/**
	 * 获取：
	 */
	public String getHdUserId() {
		return hdUserId;
	}
	/**
	 * 设置：
	 */
	public void setHdScanConfigId(String hdScanConfigId) {
		this.hdScanConfigId = hdScanConfigId;
	}
	/**
	 * 获取：
	 */
	public String getHdScanConfigId() {
		return hdScanConfigId;
	}

    public static HdScanActivityModel convert(HdScanActivityEntity entity) {
		if(entity == null) {
			return null;
		}
		HdScanActivityModel model = new HdScanActivityModel();
				model.setId(entity.getId());
				model.setMobile(entity.getMobile());
				model.setArea(entity.getArea());
				model.setMoney(entity.getMoney());
				model.setCreateTime(entity.getCreateTime());
				model.setStatus(entity.getStatus());
				model.setHdUserId(entity.getHdUserId());
				model.setHdScanConfigId(entity.getHdScanConfigId());
				
		return model;
	}
	public static List<HdScanActivityModel> convert(List<HdScanActivityEntity> entities){
		if(entities == null || entities.isEmpty()) {
			return null;
		}
		List<HdScanActivityModel> models = new ArrayList<>();
		
		for(HdScanActivityEntity entity:entities) {
			models.add(convert(entity));
		}
		
		return models;
	}
	
	public static HdScanActivityEntity convert(HdScanActivityModel model) {
		if(model == null) {
			return null;
		}
		HdScanActivityEntity entity = new HdScanActivityEntity();
				entity.setId(model.getId());
				entity.setMobile(model.getMobile());
				entity.setArea(model.getArea());
				entity.setMoney(model.getMoney());
				entity.setCreateTime(model.getCreateTime());
				entity.setStatus(model.getStatus());
				entity.setHdUserId(model.getHdUserId());
				entity.setHdScanConfigId(model.getHdScanConfigId());
				
		return entity;
	}

}
